class MissionPanel extends renderer.DisplayObjectContainer {


    constructor() {
        super();
        this.update();


        missionManager.addEventListener("missionUpdate", () => {
            this.update();
        })


    }

    update() {
        this.removeAllChildren();
        let index = 0;
        for (let mission of missionManager.missions) {
            if (
                mission.status == MissionStatus.DURGING ||
                mission.status == MissionStatus.CAN_SUBMIT) {

                const missionLabel = new renderer.TextField();
                missionLabel.x=500;
                // missionLabel.y=600;
                
                this.addChild(missionLabel);
                missionLabel.text = mission.title;
                missionLabel.y = index * 20;
                index++;
            }
        }
    }
}